package com.tianyi.sfzy1.service;

import com.tianyi.sfzy1.domain.Coursefavorite;
import com.tianyi.sfzy1.domain.Coursequestion;
import com.tianyi.sfzy1.mapper.CoursefavoriteMapper;
import com.tianyi.sfzy1.mapper.CoursequestionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoursequestionService {
    @Autowired
    private CoursequestionMapper coursequestionMapper;

    //查询所有
    public List<Coursequestion> findAll(){
        return coursequestionMapper.findAll();
    }

    //根据id查询
    public Coursequestion selectByPrimaryKey(Integer questionId){
        return coursequestionMapper.selectByPrimaryKey(questionId);
    }
    //新增
    public int insert(Coursequestion record){
        return coursequestionMapper.insert(record);
    }
    //修改全部字段
    public int updateByPrimaryKey(Coursequestion record){
        return coursequestionMapper.updateByPrimaryKey(record);
    }

    //新增全部字段
    public int insertSelective(Coursequestion record){
        return coursequestionMapper.insertSelective(record);
    }
    //删除
    public int deleteByPrimaryKey(int questionId){
        return coursequestionMapper.deleteByPrimaryKey(questionId);
    }

    //查询课程表,课程问题表,咨询表
    public List<Coursequestion> selectCourseQuestionConsultant(){
        return coursequestionMapper.selectCourseQuestionConsultant();
    }
}
